#include <cstdio>
#include <cstring>

char keyBoard[10][200] = {
	" ",
	"",
	"abc",
	"def",
	"ghi",
	"jkl",
	"mno",
	"pqrs",
	"tuv",
	"wxyz"
};

int main()
{
	
	freopen("zz_test\\test5.in", "r", stdin);
	freopen("zz_test\\test5.out", "w", stdout);
	char s[250] = {0};
	int cnt = 0;
	gets(s);
	for ( int i = 0; i < strlen(s); i++ ) {
		char ch = s[i];
		int f = 0;
		for ( int j = 0; j < 10; j ++ ) 
		{
			for ( int k = 0; k < strlen(keyBoard[j]); k++ ) 
			{
				if ( keyBoard[j][k] == ch ) {
					cnt += k + 1;
					f = 1;
					break;
				}
			}
			if ( f == 1) {
				break;
			}
		}
	}
	printf("%d", cnt);
	return 0;
} 
